const modules: any = {}
const globStore: Record<string, { default: string }> = import.meta.glob('../../src/**/*-store.ts', {
  eager: true,
})
if (globStore) {
  Object.keys(globStore).forEach((key) => {
    // key：../views/home/home-store.ts
    const pathParts = key.split('/')
    const modelKey = `use-${pathParts[pathParts.length - 1].replace('.ts', '')}`.replace(
      /-([a-z])/g,
      (match) => match[1].toUpperCase(),
    )
    modules[modelKey] = globStore[key].default
  })
}
// console.log(modules)

export default modules
